<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'PROGRAMA NACIONAL DE EGRESADOS',
        'theme' => 'rhea',
        'language'=>'es',
        'charset'=>'utf-8',
        'sourceLanguage'=> 'es_co',
	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
                'ext.giix-components.*', // giix components
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
                        'generatorPaths' => array(
                                'ext.giix-core', // giix generators
                        ),
			'password'=>'egresados',
		 	// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
	),
    

	// application components
	'components'=>array(
                'localtime'=>array(
                    'class'=>'LocalTime',
                ),
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>true,
		),
                'browser' => array(
                    'class' => 'application.extensions.browser.CBrowserComponent',
                ),
                'ePdf' => array(
                    'class'         => 'ext.yii-pdf.EYiiPdf',
                    'params'        => array(
                        'mpdf'     => array(
                            'librarySourcePath' => 'application.vendors.mpdf.*',
                            'constants'         => array(
                                '_MPDF_TEMP_PATH' => Yii::getPathOfAlias('application.runtime'),
                            ),
                            'class'=>'mpdf', // the literal class filename to be loaded from the vendors folder
                            /*'defaultParams'     => array( // More info: http://mpdf1.com/manual/index.php?tid=184
                                'mode'              => '', //  This parameter specifies the mode of the new document.
                                'format'            => 'A4', // format A4, A5, ...
                                'default_font_size' => 0, // Sets the default document font size in points (pt)
                                'default_font'      => '', // Sets the default font-family for the new document.
                                'mgl'               => 15, // margin_left. Sets the page margins for the new document.
                                'mgr'               => 15, // margin_right
                                'mgt'               => 16, // margin_top
                                'mgb'               => 16, // margin_bottom
                                'mgh'               => 9, // margin_header
                                'mgf'               => 9, // margin_footer
                                'orientation'       => 'P', // landscape or portrait orientation
                            )*/
                        ),
                        'HTML2PDF' => array(
                            'librarySourcePath' => 'application.vendors.html2pdf.*',
                            'classFile'         => 'html2pdf.class.php', // For adding to Yii::$classMap
                            'defaultParams'     => array( // More info: http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:accueil
                                'orientation' => 'P', // landscape or portrait orientation
                                'format'      => 'A4', // format A4, A5, ...
                                'language'    => 'es', // language: fr, en, it ...
                                'unicode'     => true, // TRUE means clustering the input text IS unicode (default = true)
                                'encoding'    => 'UTF-8', // charset encoding; Default is UTF-8
                                'marges'      => array(5, 5, 5, 8), // margins by default, in order (left, top, right, bottom)
                            )
                        )
                    ),
                ),
            
            
		// uncomment the following to enable URLs in path-format
		/*
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
			),
		),
		*/
		// uncomment the following to use a ORACLE database
		'db'=>array(
			'class'=>'application.extensions.PHPPDO.CPdoDbConnection',
                        'pdoClass' => 'PHPPDO',
			'connectionString' => 'oci:dbname=//127.0.0.1:1521/XE;charset=UTF8',
			'emulatePrepare' => true,
			'username' => 'egresados2',
			'password' => 'EGRESADOS2',
                        'schemaCachingDuration' => '0',
                        'enableParamLogging' => true,
                        'attributes' => array(PDO::ATTR_CASE => PDO::CASE_UPPER),
                        'initSQLs' => array(
                            // Oracle behaviour depends on particular NLS* parameter
                            // List actual settings via: select * from NLS_DATABASE_PARAMETERS
                            // example 1: decimal separator: NLS_NUMERIC_CHARACTERS => ".," means, that dot [.] = decimal separator, and comma [,] is for thousands separator
                            // for PHP we must set [NLS_NUMERIC_CHARACTERS => ". "] - applicable to middle european regional settings
                            "ALTER SESSION SET NLS_NUMERIC_CHARACTERS = '. '",
                            // example 2: setting SELECT LIKE ... to be accent and case sensitive mode:
                            'ALTER SESSION SET NLS_COMP=ANSI', 
                            'ALTER SESSION SET NLS_COMP=LINGUISTIC',
                            'ALTER SESSION SET NLS_SORT=GENERIC_BASELETTER',
                            'ALTER SESSION SET NLS_SORT=BINARY_AI',
                            "ALTER SESSION SET NLS_TIMESTAMP_FORMAT='DD-MM-RR HH:MI:SS AM'",
                            "ALTER SESSION SET NLS_DATE_FORMAT='DD-MM-RR'",
                        ),
		),
                // uncomment the following to use a MySql database
//                'db'=>array(
//			'class'=>'application.extensions.PHPPDO.CPdoDbConnection',
//			'pdoClass' => 'PHPPDO',
//			'connectionString' => 'mysql:host=localhost;dbname=egresados',
//			'emulatePrepare' => true,
//			'username' => 'root',
//			'password' => 'root',
//			'charset' => 'utf8',
//		),
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'freddy.alarcon@mggroup.com.co',
	),
);